package io.dubbo.springboot;

import com.alibaba.dubbo.config.annotation.Service;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.boot.context.properties.ConfigurationProperties;

@Setter
@Getter
@ToString
@ConfigurationProperties(prefix = "spring.dubbo")
public class DubboProperties {

    /**
     * 默认的超时时间
     */
    public static final int DEFAULT_TIME_OUT = 3000;

    /**
     * dubbo application name
     */
    private String appname;

    /**
     * dubbo registry address
     */
    private String registry;

    /**
     * communication protocol, default is dubbo
     */
    private String protocol = "dubbo";

    /**
     * dubbo listen port, default 20800
     */
    private int port = 20800;

    /**
     * dubbo thread count, default 200
     */
    private int threads = 200;

    /**
     * 超时时间 may override by {@link Service#timeout()} ()}
     */
    private int timeout = DEFAULT_TIME_OUT;

    /**
     * dubbo version, may override by {@link com.alibaba.dubbo.config.annotation.Service#version()}
     */
    private String version = "";

    /**
     * dubbo group, may override by {@link com.alibaba.dubbo.config.annotation.Service#group()}
     */
    private String group = "";

    /**
     * 高速序列化接口 可选 （ kryo，fst）
     */
    private String serialization = "";

}
